package com.mall.shopping.converter;

import com.mall.shopping.dal.entitys.Item;
import com.mall.shopping.dto.MyProductDTO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

@Mapper(componentModel = "spring")
public interface MyProductConvertor {

    @Mappings(
            {
                    @Mapping(source = "title",target = "productName"),
                    @Mapping(source = "price",target = "price"),
                    @Mapping(source = "num",target = "num")
            }
    )
    MyProductDTO convert2DTO(Item item);
}
